//
//  BusinessViewCell.m
//  EasyToTesco2.0
//
//  Created by 杨森 on 16/6/6.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "BusinessViewCell.h"

@interface BusinessViewCell()

@end

@implementation BusinessViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
     
        [self addUI];
    }
    return self;
}



- (void)addUI
{
    CGFloat Margin = 10;
    
    //商家图片
    self.shopsImg = [[UIImageView alloc] initWithFrame:CGRectMake(Margin,Margin,self.width/3,HEIGHT/6-Margin*2)];
    [self addSubview:_shopsImg];
    
    //商家名字
    self.shopsNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_shopsImg.frame)+Margin,Margin,self.width/5*2+10,14)];
    
    _shopsNameLabel.font = [UIFont systemFontOfSize:14];
//    _shopsNameLabel.textColor = [UIColor grayColor];
    [self addSubview:_shopsNameLabel];
    
    //商家详情
    self.shopsDetailsLabel = [[UILabel alloc] init];
    _shopsDetailsLabel.font = [UIFont systemFontOfSize:12];
    _shopsDetailsLabel.numberOfLines = 2;
    _shopsDetailsLabel.textColor = [UIColor grayColor];
    [self addSubview:_shopsDetailsLabel];
    _shopsDetailsLabel.frame = CGRectMake(_shopsNameLabel.x,CGRectGetMaxY(_shopsNameLabel.frame)+Margin/2,self.width-_shopsImg.width-25,40);
    
    //商家地址
    self.shopsAddress = [UIButton buttonWithType:UIButtonTypeCustom];
    _shopsAddress.userInteractionEnabled = false;
    [_shopsAddress setImage:[UIImage imageNamed:@"shangjia_1"] forState:UIControlStateNormal];
    _shopsAddress.titleLabel.font = [UIFont systemFontOfSize:10];
    [_shopsAddress setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self addSubview:_shopsAddress];
    _shopsAddress.frame = CGRectMake(WIDTH-WIDTH/6,Margin,self.width/6,12);
    _shopsAddress.titleEdgeInsets = UIEdgeInsetsMake(0,5, 0, 0);
    
}

@end
